package cn.minsh.lims.eoms.modules.app.controller.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.annotations.Update;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;
import java.util.Date;
import java.util.List;

/**
 * @author Administrator
 */
@Data
@ApiModel("保养计划")
public class MaintenancePlanReq {
    @ApiModelProperty("保养计划id,修改必填")
    @NotNull(groups = {Update.class},message = "计划id不能为空")
    private Long id ;

    @ApiModelProperty("保养计划名称")
    @Length(max = 20,message = "保养计划名称不能超过20个字符")
    @NotBlank(message = "保养计划名称不能为空")
    private String name;

    @ApiModelProperty("保养类型：校准、检定等（字典维护）")
    @NotNull(message = "保养类型不能为空")
    private Integer level;

    @ApiModelProperty("首次保养时间")
    @NotNull(message = "首次保养时间不能为空")
    private Date firstPlanDate;

    @ApiModelProperty("巡检频率：1每日2每周3每月4每年5不重复")
    @NotNull(message = "巡检频率不能为空")
    @Min(value = 1,message = "巡检频率区间为1至5")
    @Max(value = 5,message = "巡检频率区间为1至5")
    private Integer frequency;

    @ApiModelProperty("保养提醒，大于0的提醒时间")
    private List<Integer> remind;

    @ApiModelProperty("经办人")
    @NotNull(message = "经办人不能为空")
    private Long agentId;

    @ApiModelProperty("失效时间")
    private Date invalidTime;

    @ApiModelProperty("保养内容列表，字符串列表")
    @NotEmpty(message = "保养内容列表不能为空")
    private List<String> contentList ;

    @ApiModelProperty("保养范围")
    @NotEmpty(message = "保养范围不能为空")
    private List<Long> scopeIdList ;

}
